import prompt from '@ohos.promptAction'

const SHORT_TIME = 2 * 1000
const LONG_TIME = 4 * 1000

export class ToastUtil {
  showShortToast(msg) {
    prompt.showToast({ message: msg, duration: SHORT_TIME })
  }

  showLongToast(msg) {
    prompt.showToast({ message: msg, duration: LONG_TIME })
  }

  showCustomToast(msg, duration) {
    prompt.showToast({ message: msg, duration: duration })
  }
}

let toastUtil = new ToastUtil();

export default toastUtil as ToastUtil
